<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	
	// with(aaa) 将代码的作用域链最顶端变为括号里的，如果括号里的没有，会在作用域链上找
	var aaa = {
		name:'aaa的名称'
	}
	function bbb(){
		var name = 'bbb的名称';
		var age = 'bbb的年龄'
		with(aaa){
			console.log(name)
			console.log(age)
		}
	}
	bbb()
	
	var c = {
		c1:{
			name: 'c1_name'
		},
		c2:{
			name: 'c2_name'
		}
	}
	with (c.c1){
		console.log(name)
	}
</script>